﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Data;
using System.Data.SqlClient;
using Models;


namespace DAL
{
   public class LongLineDAL
    {
       /// <summary>
        /// 石邦友乘客发布长途拼车
       /// </summary>
       /// <returns></returns>
       public static DataTable Changtu() 
       { 
       //添加sql语句
           string sql = "select * from LongLine";
       //调用DBHeleper
      return DBHelper.Instance().GetDataTableBySql(sql);
       }
     //车主发布长途线路信息
       public static bool Addline(LongLine model)
       {
           string sql = string.Format(@"insert into LongLine values
({0},'{1}','{2}','{3}','{4}',{5},{6},'{7}',{8},'{9}',{10},'{11}','{12}')"
       , model.UesrID, model.GoCity, model.ToCity, model.GoTime, model.Times, model.CJpeople, model.RNpeople, model.Says, model.CarTypeID, model.StarTime,
       model.CostWays, model.Users);
           bool result = DBHelper.Instance().ExcuteSql(sql);
           return result;
       }
    }
}
